package com.editso.haier.result;


import com.editso.haier.configure.ResultCodeConvert;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@JsonSerialize(using = ResultCodeConvert.class)
public enum ResultCode {
    SUCCESS(2000, "成功"),
    FAILURE(4000, "失败"),
    EXISTS(2005, "资源已存在"),
    NO_LOGIN(2030, "帐号未登陆"),
    LOGIN_ERROR(2020, "帐号或密码错误"),
    TOPIC_ERROR(2040, "主题错误"),
    UPLOAD_OK(2010, "上传文件成功!")
    ;
    private final int code;
    private final String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
